package com.lwq.springbootswagger.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liwq
 * @description
 * @date 2021/7/12 16:57
 */
@Slf4j
@Api("HelloController列表")
@RestController
public class HelloController {

    @ApiOperation(value = "获取人员信息", notes = "获取人员信息")
    @GetMapping("sayHello")
    public String sayHello(String username) {
        log.info("hello:" + username);
        return "hello" + username;
    }

    @ApiOperation(value = "查询所有信息", notes = "查询所有信息")
    @GetMapping(value = "/queryAll")
    public List<String> queryAll() throws Exception {
        List<String> data = new ArrayList<String>();
        data.add("张三");
        data.add("李四");
        System.out.println("查询所有信息:" + data.toString());
        log.info("查询所有信息:" + data.toString());
        return data;
    }
}
